package cn.com.cifi.mars.web.action.price;

import cn.com.cifi.mars.bean.vo.price.*;
import cn.com.cifi.mars.bean.vo.price.req.PriceWarPlanReqParam;
import cn.com.cifi.mars.common.bean.R;
import cn.com.cifi.mars.common.constants.VersionConstant;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

@Api(tags = "货值管理API")
@RequestMapping("/${spring.data.rest.base-path}/{apiVersion}/price")
public interface IPriceMgrController {

    @ApiOperation(value = "创建货值管理手动新建版本", notes = "创建货值管理手动新建版本")
    @PostMapping(value = "priceVersion")
    public R<String> createPriceVersion(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "分期Id", required = true) @RequestParam(name = "projectFid") String projectFid,
            @ApiParam(value = "版本类型(投决会版 战规版 大定价版 动态版)", required = true, defaultValue = "0") @RequestParam(name = "versionType") String versionType);

    
    @ApiOperation(value = "创建货值普调版本", notes = "创建货值普调版本")
    @PostMapping(value = "batchAdjustPriceVersion")
    public R<String> createBatchAdjustPriceVersion(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "分期Id", required = true) @RequestParam(name = "projectFid") String projectFid,
            @ApiParam(value = "版本类型", required = true, defaultValue = "") @RequestParam(name = "versionType") String versionType
    		);


    @ApiOperation(value = "查询货值管理版本列表", notes = "查询货值管理版本列表")
    @GetMapping(value = "priceVersionList")
    public R<PriceVersionListVO> getPriceVersionList(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "分期Id", required = true) @RequestParam(name = "projectFid") String projectFid,
            @ApiParam(value = "版本类型(投决会版 战规版 大定价版 动态版)", required = true) @RequestParam(name = "versionType") String versionType);


    @ApiOperation(value = "查询货值管理信息", notes = "查询货值管理信息")
    @GetMapping(value = "priceVersion")
    public R<PriceSelectItemVO> getPriceVersion(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "版本Id", required = true) @RequestParam(name = "versionId") String versionId);


    @ApiOperation(value = "查询货值管理信息详情", notes = "查询货值管理信息详情")
    @GetMapping(value = "priceVersionDetail")
    public R<PriceVersionListVO> priceVersionDetail(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "版本Id", required = true) @RequestParam(name = "versionId") String versionId);


    @ApiOperation(value = "删除货值管理版本信息", notes = "删除货值管理版本信息")
    @DeleteMapping(value = "priceVersion")
    public R<String> deletePriceVersion(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "版本Id", required = true) @RequestParam(name = "versionId") String versionId);


    @ApiOperation(value = "保存货值管理", notes = "保存价格管理")
    @PutMapping(value = "priceVersionOrg")
    public R saveWarPlanPriceVersion(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @RequestBody PriceWarPlanReqParam priceWarPlanReqParam);


    @ApiOperation(value = "货值管理版本修改状态", notes = "货值管理版本修改状态")
    @PutMapping(value = "priceVersionUpdateState")
    public R priceVersionUpdateState(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "版本Ids", required = true) @RequestParam(name = "versionIds") List<String> versionIds,
            @ApiParam(value = "版本状态", required = true) @RequestParam(name = "versionState") String versionState);


    @ApiOperation(value = "货值管理版本当前分期最新版本信息", notes = "货值管理版本当前分期最新版本信息")
    @GetMapping(value = "priceNewestVersion")
    public R<PriceNewestVersion> priceNewestVersion(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "分期Id", required = true) @RequestParam(name = "projectFid") String projectFid);


    @ApiOperation(value = "货值管理版本对比版本信息", notes = "货值管理版本对比基础信息")
    @GetMapping(value = "priceVersionCompareBasicInfo")
    public R<PriceCompareBasicInfoVO> priceVersionCompareBasicInfo(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "项目Id", required = true) @RequestParam(name = "projectId") String projectId,
            @ApiParam(value = "版本类型(投资版 战规版 大定价版 动态版 全盘)", required = true) @RequestParam(name = "versionType") List<String> versionTypes);


    @ApiOperation(value = "货值管理版本对比", notes = "货值管理版本对比")
    @PostMapping(value = "priceVersionCompare")
    public R<List<ApprovedDiffDetailVO>> priceVersionCompare(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @RequestBody List<PriceCompareVersionIdsVO> priceCompareVersionIdsVOs);


    @ApiOperation(value = "货值差异概览", notes = "货值差异概览")
    @PostMapping(value = "/valueDifferenceReview")
    R<DifferenceReviewVersionVO> valueDifferenceReview(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "对比类型code", required = true) @RequestParam(name = "code") String code,
            @RequestBody List<PriceCompareVersionIdsVO> priceCompareVersionIdsVOs);


    @ApiOperation(value = "货值管理重新打考核标签", notes = "货值管理重新打考核标签")
    @PutMapping(value = "priceVersionAssessmentLable")
    public R priceVersionAssessmentLable(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "版本Id", required = true) @RequestParam(name = "versionId") String versionId);


    @ApiOperation(value = "货值管理简单校验", notes = "货值管理简单校验")
    @GetMapping(value = "priceVersionValidated")
    public R<String> priceVersionValidated(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "版本Id", required = true) @RequestParam(name = "versionId") String versionId);


    @ApiOperation(value = "货值管理金蝶迁移", notes = "货值管理金蝶迁移")
    @PostMapping(value = "priceVersionTransfer")
    public R<Map<String, String>> priceVersionTransfer(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion);


    @ApiOperation(value = "货值管理指定项目和时间节点定稿生成", notes = "货值管理指定项目分期和时间节点定稿生成")
    @PostMapping(value = "priceFinalizationToProjectAndTime")
    public R<Map<String, String>> priceFinalizationToProjectAndTime(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "分期ID", required = true) @RequestParam(name = "stageId") String stageId,
            @ApiParam(value = "定稿时间(yyyy-MM-dd)", required = true) @RequestParam(name = "finalizationTime") String finalizationTime);


    @ApiOperation(value = "货值管理全部导出", notes = "货值管理全部导出")
    @GetMapping(value = "priceExcelExport")
    public void priceExcelExport(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            HttpServletRequest request, HttpServletResponse response,
            @ApiParam(value = "货值版本id", required = true) @RequestParam(name = "versionId") String versionId);


    @ApiOperation(value = "异常创建货值管理手动新建版本", notes = "异常创建货值管理手动新建版本")
    @PostMapping(value = "exceptionPriceVersion")
    public R<String> exceptionPriceVersion(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "分期Id", required = true) @RequestParam(name = "projectFid") String projectFid,
            @ApiParam(value = "版本类型(投决会版 战规版)", required = true, defaultValue = "0") @RequestParam(name = "versionType") String versionType);


    @ApiOperation(value = "明源定调价通知刷新指定货值版本", notes = "明源定调价通知刷新指定货值版本")
    @PostMapping(value = "modifyNoticeByVersionId")
    public void modifyNoticeByVersionId(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "版本Id", required = true) @RequestParam(name = "versionId") String versionId,
            @RequestBody String msg);
	

    @ApiOperation(value = "刷新分期下货值版本实际数据", notes = "刷新分期下货值版本实际数据")
    @PostMapping(value = "refreshPriceValueByStageId")
    public R<String> refreshPriceValueByStageId(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "分期Id", required = true) @RequestParam(name = "projectFid") String projectFid);
    
    @ApiOperation(value = "查询集团审批版版本列表", notes = "查询集团审批版版本列表")
    @GetMapping(value = "groupPriceVersionList")
    public R<GroupPriceVersionListVO> groupPriceVersionList(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "项目Id", required = true) @RequestParam(name = "projectId") String projectId);
    
    @ApiOperation(value = "查询集团审批版信息", notes = "查询集团审批版信息")
    @GetMapping(value = "groupPriceVersion")
    public R<GroupPriceDetailVO> groupPriceVersion(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "版本Id", required = true) @RequestParam(name = "versionId") String versionId);

    
    @ApiOperation(value = "批量刷新货值版本实际数据", notes = "批量刷新货值版本实际数据")
    @PostMapping(value = "batchrefreshPriceValue")
    public R<String> batchrefreshPriceValue(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "月份", required = false) @RequestParam(name = "yearmonth") String yearmonth,
            @ApiParam(value = "分期Id", required = false) @RequestParam(name = "projectFid") String projectFid,
            @ApiParam(value = "版本ID", required = false) @RequestParam(name = "versionId") String versionId,
            @ApiParam(value = "type", required = false) @RequestParam(name = "type") String type);

}
